<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>isFunction</title>
</head>

<body>
    <script>
        const isFunction = val => typeof val === 'function';
        document.writeln(`x => x${isFunction(x => x) ? '' : '不'}是一个函数`)
    </script>
</body>

</html>